const Router = require('koa-router')
const router = new Router()
const koaBody = require('koa-bodyparser');

const collect = require('../model/collect');
router.post('/getcollect', koaBody(), async (ctx, next) => {
    const username = ctx.request.body.username;
    const usercollect = await collect.GETCOLLECT(username);
    ctx.body = usercollect;
    

})

router.post('/addcollect', koaBody(), async (ctx, next) => {
    const username = ctx.request.body.username;
    const addcollect = ctx.request.body.addcollect;
    const usercollect = await collect.ADDCOLLECT(username,addcollect);
    ctx.body = usercollect;
})



module.exports = router;